<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>充值</title>
    <include file="../simpleboot3/public@function"/>
    <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/layer/layer.js"></script>
    <style>
        input{margin:10px 10px 10px 10px;}
    </style>
	<style type="text/css">
	body,input{ font-family:"微软雅黑";}
        input{margin:10px 10px 10px 10px;
    border-radius: 5px;
    height: 40px;
    width: 260px;
    border: solid 1px #57b99f;}
	select{margin:10px 10px 10px 10px;    border-radius: 5px;
    height: 40px;
    width: 260px;
    border: solid 1px #57b99f;}
    </style>
</head>
<body style="background: rgba(28, 109, 42, 0.19)">
	<form method="post" name="form2" id="form2" >
		<div style=" width:870px; height:100%; margin:0 auto; color:#252525;">
         <input type="hidden" id="type" value="">
		 <div>账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:<div id="phone" style="display:inline"><input type="text"  name="mobile" value="" readonly></div></div>
         <div>充值金额:<div id="money" style="display:inline"><input type="text" name="money"  value=""></div></div>
	     <input type="submit" value="确定"  id="sub" style="height: 45px;width: 155px; background:#57b99f; color:#fff; font-size:16px; cursor:pointer"/>
		 </div>
	</form>
</body>
<script>
    var phone=parent.$('#phone').val();
    var type=parent.$('#type').val();
     $('#phone').html('<input type="text" name="mobile" value="'+phone+'" readonly></div>');
     $('#type').val(type);
     $('#sub').click(function () {
         var phone=$("#phone>input[type=text]").val();
         var money=$('#money>input[type=text]').val();
         var type=$('#type').val();
         if(money<0)
         {
             alert('充值数额不对');
             return false;
         }
         var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
         $.post("{:url('member/chongPost')}",{phone:phone,money:money,type:type},function (date) {
                alert(date.msg.con);
                if(date.msg.sta==1)
                    {
                        parent.$('#money').val(date.msg.money);
                        parent.$('#integral').val(date.msg.integral);
                        parent.layer.close(index); //执行关闭
                    }
         },'json')
     })
</script>
</html>

